<?php

namespace app\api\controller;

use app\common\model\PortalArticle;

class PortalController
{
    
    /**
     * 获取文章
     */
    public function article()
    {
        $id = request()->get('id', 0);
        $where[] = ['id', '=', $id];
        $where[] = ['status', '=', 1];
        $data = PortalArticle::where($where)->find();
        if (empty($data)) {
            return apiError('未找到该文章');
        }
        return apiSuccess(data: $data);
    }
    
}